package com.example.lib_login.view

import android.content.Context
import android.util.AttributeSet
import org.sufficientlysecure.htmltextview.HtmlTextView

class AgreementView(context: Context,attrs:AttributeSet?) :HtmlTextView(context, attrs){
    init {
        val text = "进入下一步前，请阅读并同意网易云音乐的《服务条款》、《隐私政策》、《天翼账号服务协议》"
        val html = this as HtmlTextView
        //substring用于获取指定字符串的子字符串
        val p1 = text.substring(0,19)
        val p2 = text.substring(19)
        val colorString = "<font color=#507AAC><b>$p2</b></font>"
        html.setHtml("$p1$colorString")
        html.textSize = 13f
    }

}